// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Message describing a MC Source of type Guest OS Scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GuestOsScan {
    /// reference to the corresponding Guest OS Scan in MC Source.
    pub core_source: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GuestOsScan {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [core_source][crate::model::GuestOsScan::core_source].
    pub fn set_core_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.core_source = v.into();
        self
    }
}

impl wkt::message::Message for GuestOsScan {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.GuestOsScan"
    }
}

/// Message describing a MC Source of type VSphere Scan.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VSphereScan {
    /// reference to the corresponding VSphere Scan in MC Source.
    pub core_source: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VSphereScan {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [core_source][crate::model::VSphereScan::core_source].
    pub fn set_core_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.core_source = v.into();
        self
    }
}

impl wkt::message::Message for VSphereScan {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.VSphereScan"
    }
}

/// Message describing Collector object.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Collector {
    /// name of resource.
    pub name: std::string::String,

    /// Output only. Create time stamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time stamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels as key value pairs.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// User specified name of the Collector.
    pub display_name: std::string::String,

    /// User specified description of the Collector.
    pub description: std::string::String,

    /// Service Account email used to ingest data to this Collector.
    pub service_account: std::string::String,

    /// Output only. Store cloud storage bucket name (which is a guid) created with
    /// this Collector.
    pub bucket: std::string::String,

    /// User specified expected asset count.
    pub expected_asset_count: i64,

    /// Output only. State of the Collector.
    pub state: crate::model::collector::State,

    /// Output only. Client version.
    pub client_version: std::string::String,

    /// Output only. Reference to MC Source Guest Os Scan.
    pub guest_os_scan: std::option::Option<crate::model::GuestOsScan>,

    /// Output only. Reference to MC Source vsphere_scan.
    pub vsphere_scan: std::option::Option<crate::model::VSphereScan>,

    /// How many days to collect data.
    pub collection_days: i32,

    /// Uri for EULA (End User License Agreement) from customer.
    pub eula_uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Collector {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Collector::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Collector::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Collector::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Collector::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Collector::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Collector::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [display_name][crate::model::Collector::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Collector::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [service_account][crate::model::Collector::service_account].
    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_account = v.into();
        self
    }

    /// Sets the value of [bucket][crate::model::Collector::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [expected_asset_count][crate::model::Collector::expected_asset_count].
    pub fn set_expected_asset_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.expected_asset_count = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Collector::state].
    pub fn set_state<T: std::convert::Into<crate::model::collector::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [client_version][crate::model::Collector::client_version].
    pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.client_version = v.into();
        self
    }

    /// Sets the value of [guest_os_scan][crate::model::Collector::guest_os_scan].
    pub fn set_guest_os_scan<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::GuestOsScan>,
    {
        self.guest_os_scan = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [guest_os_scan][crate::model::Collector::guest_os_scan].
    pub fn set_or_clear_guest_os_scan<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::GuestOsScan>,
    {
        self.guest_os_scan = v.map(|x| x.into());
        self
    }

    /// Sets the value of [vsphere_scan][crate::model::Collector::vsphere_scan].
    pub fn set_vsphere_scan<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::VSphereScan>,
    {
        self.vsphere_scan = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [vsphere_scan][crate::model::Collector::vsphere_scan].
    pub fn set_or_clear_vsphere_scan<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::VSphereScan>,
    {
        self.vsphere_scan = v.map(|x| x.into());
        self
    }

    /// Sets the value of [collection_days][crate::model::Collector::collection_days].
    pub fn set_collection_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.collection_days = v.into();
        self
    }

    /// Sets the value of [eula_uri][crate::model::Collector::eula_uri].
    pub fn set_eula_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.eula_uri = v.into();
        self
    }
}

impl wkt::message::Message for Collector {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.Collector"
    }
}

/// Defines additional types related to [Collector].
pub mod collector {
    #[allow(unused_imports)]
    use super::*;

    /// -- Using suggestion from API Linter Analyzer for nesting enum --
    /// -- <https://linter.aip.dev/216/nesting> --
    /// State of a Collector (server_side).
    /// States are used for internal purposes and named to keep
    /// convention of legacy product:
    /// <https://cloud.google.com/migrate/stratozone/docs/about-stratoprobe>.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Collector state is not recognized.
        Unspecified,
        /// Collector started to create, but hasn't been completed MC source creation
        /// and db object creation.
        Initializing,
        /// Collector has been created, MC source creation and db object creation
        /// completed.
        ReadyToUse,
        /// Collector client has been registered with client.
        Registered,
        /// Collector client is actively scanning.
        Active,
        /// Collector is not actively scanning.
        Paused,
        /// Collector is starting background job for deletion.
        Deleting,
        /// Collector completed all tasks for deletion.
        Decommissioned,
        /// Collector is in error state.
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Initializing => std::option::Option::Some(1),
                Self::ReadyToUse => std::option::Option::Some(2),
                Self::Registered => std::option::Option::Some(3),
                Self::Active => std::option::Option::Some(4),
                Self::Paused => std::option::Option::Some(5),
                Self::Deleting => std::option::Option::Some(6),
                Self::Decommissioned => std::option::Option::Some(7),
                Self::Error => std::option::Option::Some(8),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Initializing => std::option::Option::Some("STATE_INITIALIZING"),
                Self::ReadyToUse => std::option::Option::Some("STATE_READY_TO_USE"),
                Self::Registered => std::option::Option::Some("STATE_REGISTERED"),
                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
                Self::Paused => std::option::Option::Some("STATE_PAUSED"),
                Self::Deleting => std::option::Option::Some("STATE_DELETING"),
                Self::Decommissioned => std::option::Option::Some("STATE_DECOMMISSIONED"),
                Self::Error => std::option::Option::Some("STATE_ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Initializing,
                2 => Self::ReadyToUse,
                3 => Self::Registered,
                4 => Self::Active,
                5 => Self::Paused,
                6 => Self::Deleting,
                7 => Self::Decommissioned,
                8 => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "STATE_INITIALIZING" => Self::Initializing,
                "STATE_READY_TO_USE" => Self::ReadyToUse,
                "STATE_REGISTERED" => Self::Registered,
                "STATE_ACTIVE" => Self::Active,
                "STATE_PAUSED" => Self::Paused,
                "STATE_DELETING" => Self::Deleting,
                "STATE_DECOMMISSIONED" => Self::Decommissioned,
                "STATE_ERROR" => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Initializing => serializer.serialize_i32(1),
                Self::ReadyToUse => serializer.serialize_i32(2),
                Self::Registered => serializer.serialize_i32(3),
                Self::Active => serializer.serialize_i32(4),
                Self::Paused => serializer.serialize_i32(5),
                Self::Deleting => serializer.serialize_i32(6),
                Self::Decommissioned => serializer.serialize_i32(7),
                Self::Error => serializer.serialize_i32(8),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.rapidmigrationassessment.v1.Collector.State",
            ))
        }
    }
}

/// Message describing an Annotation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Annotation {
    /// name of resource.
    pub name: std::string::String,

    /// Output only. Create time stamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time stamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Labels as key value pairs.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Type of an annotation.
    pub r#type: crate::model::annotation::Type,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Annotation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Annotation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Annotation::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Annotation::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Annotation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Annotation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Annotation::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [r#type][crate::model::Annotation::type].
    pub fn set_type<T: std::convert::Into<crate::model::annotation::Type>>(mut self, v: T) -> Self {
        self.r#type = v.into();
        self
    }
}

impl wkt::message::Message for Annotation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.Annotation"
    }
}

/// Defines additional types related to [Annotation].
pub mod annotation {
    #[allow(unused_imports)]
    use super::*;

    /// Types for project level setting.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Unknown type
        Unspecified,
        /// Indicates that this project has opted into StratoZone export.
        LegacyExportConsent,
        /// Indicates that this project is created by Qwiklab.
        Qwiklab,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::LegacyExportConsent => std::option::Option::Some(1),
                Self::Qwiklab => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::LegacyExportConsent => {
                    std::option::Option::Some("TYPE_LEGACY_EXPORT_CONSENT")
                }
                Self::Qwiklab => std::option::Option::Some("TYPE_QWIKLAB"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::LegacyExportConsent,
                2 => Self::Qwiklab,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "TYPE_LEGACY_EXPORT_CONSENT" => Self::LegacyExportConsent,
                "TYPE_QWIKLAB" => Self::Qwiklab,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::LegacyExportConsent => serializer.serialize_i32(1),
                Self::Qwiklab => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.rapidmigrationassessment.v1.Annotation.Type",
            ))
        }
    }
}

/// Message for creating an AnnotationS.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAnnotationRequest {
    /// Required. Name of the parent (project+location).
    pub parent: std::string::String,

    /// Required. The resource being created.
    pub annotation: std::option::Option<crate::model::Annotation>,

    /// Optional. An optional request ID to identify requests.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateAnnotationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateAnnotationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [annotation][crate::model::CreateAnnotationRequest::annotation].
    pub fn set_annotation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Annotation>,
    {
        self.annotation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [annotation][crate::model::CreateAnnotationRequest::annotation].
    pub fn set_or_clear_annotation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Annotation>,
    {
        self.annotation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateAnnotationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateAnnotationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest"
    }
}

/// Message for getting a specific Annotation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAnnotationRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetAnnotationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetAnnotationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetAnnotationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest"
    }
}

/// Message for creating a Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCollectorRequest {
    /// Required. Name of the parent (project+location).
    pub parent: std::string::String,

    /// Required. Id of the requesting object.
    pub collector_id: std::string::String,

    /// Required. The resource being created.
    pub collector: std::option::Option<crate::model::Collector>,

    /// Optional. An optional request ID to identify requests.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateCollectorRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [collector_id][crate::model::CreateCollectorRequest::collector_id].
    pub fn set_collector_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.collector_id = v.into();
        self
    }

    /// Sets the value of [collector][crate::model::CreateCollectorRequest::collector].
    pub fn set_collector<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Collector>,
    {
        self.collector = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [collector][crate::model::CreateCollectorRequest::collector].
    pub fn set_or_clear_collector<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Collector>,
    {
        self.collector = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateCollectorRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest"
    }
}

/// Message for requesting list of Collectors.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCollectorsRequest {
    /// Required. Parent value for ListCollectorsRequest.
    pub parent: std::string::String,

    /// Requested page size. Server may return fewer items than requested.
    /// If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Filtering results.
    pub filter: std::string::String,

    /// Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCollectorsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListCollectorsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListCollectorsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListCollectorsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListCollectorsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListCollectorsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListCollectorsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest"
    }
}

/// Message for response to listing Collectors.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCollectorsResponse {
    /// The list of Collectors.
    pub collectors: std::vec::Vec<crate::model::Collector>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCollectorsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [collectors][crate::model::ListCollectorsResponse::collectors].
    pub fn set_collectors<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Collector>,
    {
        use std::iter::Iterator;
        self.collectors = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListCollectorsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListCollectorsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListCollectorsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListCollectorsResponse {
    type PageItem = crate::model::Collector;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.collectors
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for getting a specific Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCollectorRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetCollectorRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.GetCollectorRequest"
    }
}

/// Message for deleting a Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCollectorRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteCollectorRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteCollectorRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest"
    }
}

/// Message for updating a Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCollectorRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// Collector resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The resource being updated.
    pub collector: std::option::Option<crate::model::Collector>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateCollectorRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateCollectorRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [collector][crate::model::UpdateCollectorRequest::collector].
    pub fn set_collector<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Collector>,
    {
        self.collector = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [collector][crate::model::UpdateCollectorRequest::collector].
    pub fn set_or_clear_collector<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Collector>,
    {
        self.collector = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateCollectorRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest"
    }
}

/// Message for resuming a Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResumeCollectorRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResumeCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ResumeCollectorRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::ResumeCollectorRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for ResumeCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest"
    }
}

/// Message for registering a Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegisterCollectorRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RegisterCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RegisterCollectorRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::RegisterCollectorRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for RegisterCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest"
    }
}

/// Message for pausing a Collector.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PauseCollectorRequest {
    /// Required. Name of the resource.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PauseCollectorRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PauseCollectorRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::PauseCollectorRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for PauseCollectorRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have [Operation.error][] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.rapidmigrationassessment.v1.OperationMetadata"
    }
}
